---NEW INSERT COMMAND BY JACKIE： New role who can place order with charge $4.99 15% GST
IF NOT EXISTS (SELECT 1 FROM PermissionRecord Where SystemName='MemberShipWithFixedRate')
BEGIN
INSERT INTO PermissionRecord (Name, SystemName, Category)
VALUES ('Logistics area. Place any order with fixed shipping rate.', 'MemberShipWithFixedRate', 'Logistics');
END

---It is better to add one customer role in Admin/CustomerRole/List (without using sql command). The system name can be MemberShipWithFixedRate.
GO
---add RefundQuantity for opv if they are partially refund
IF COL_LENGTH('OrderProductVariant', 'RefundQuantity') IS NULL
BEGIN
ALTER TABLE OrderProductVariant 
ADD RefundQuantity INT NULL
END

GO
---add SpotshubPackageSize for shipment
IF COL_LENGTH('Shipment', 'SpotshubPackageSize') IS NULL
BEGIN
ALTER TABLE Shipment 
ADD SpotshubPackageSize INT Not NULL default(0)
END

GO
---add DistrictId for Branch -- due to invalid DistrictId error -- occur by May 20 Wangyjx_cp check in
IF COL_LENGTH('Branch','DistrictId') IS NULL
BEGIN
ALTER TABLE Branch 
ADD DistrictId INT Not NULL default(1)
END

GO
---May 26. Is open-box product variant for open-box product variant
IF COL_LENGTH('ProductVariant','IsOpenBoxProductVariant') IS NULL
BEGIN
ALTER TABLE ProductVariant 
ADD IsOpenBoxProductVariant BIT Not NULL default(0)
END

GO
---May 27. BoundProductVariantId: the connection between original product variant and open box product variant
IF COL_LENGTH('ProductVariant', 'BoundProductVariantId') IS NULL
BEGIN
ALTER TABLE ProductVariant 
ADD BoundProductVariantId INT NULL
END

GO
--June 4th new resource Products.Details.AvailableQuantity
IF NOT EXISTS (SELECT 1 FROM LocaleStringResource Where ResourceName='Products.Details.AvailableQuantity')
BEGIN
INSERT INTO LocaleStringResource(LanguageId,ResourceName,ResourceValue)
VALUES(1,'Products.Details.AvailableQuantity','Available Quantity')
END